<template>
  <div class="w750">
    <!-- 订单详情 -->
    <div class="order-detail">
      <div class="order-state">
        <div class="state-txt">
          <div class="sta">交易成功</div>
          <div class="des">感谢您在小羊云商购物，欢迎您再次光临</div>
        </div>
        <div class="state-img">
          <img src="../../assets/images/order-state.png" alt="">
        </div>
      </div>
      <div class="order-msg logistics">
        <div class="user-info">
          <img src="../../assets/images/logistics.png" alt="">
          <em class="item">[代收点]您的快递已从代理点取出</em>
        </div>
        <div class="address-det">2018-09-28 11:55:02</div>
        <i class="arr">
          <img src="../../assets/images/arrow.png" alt="">
        </i>
      </div>
      <div class="order-msg">
        <div class="user-info">
          <img src="../../assets/images/sub-local.png" alt="">
          <em class="item">惊叹的力量</em>
          <em class="item">15183545637</em>
        </div>
        <div class="address-det">广东省 广州市 海珠区 中洲交易中心1504</div>
      </div>
      <div class="order-list">
        <div class="list-item">
          <div class="pro-mes">
            <div class="pro-img">
              <!-- <img src="img/det-img.jpg" alt=""> -->
            </div>
            <div class="pro-name">
              <span class="name">{{orderArr.orderItemDtos[0].prodName}}</span>
              <div class="goods-btn">
                <span class="price" style="color: #4eae31;">
                  <em class="now" style="color: #4eae31;">{{item.orderItemDtos[0].price}}</em> 积分
                </span>
              </div>
              <div class="pro-num">×{{orderArr.orderItemDtos[0].basketCount}}</div>
            </div>
          </div>
        </div>
      </div>
      <div class="order-other-msg">
        <div class="item-box">
          <div class="other-item">
            <b class="item-b">订单编号：</b>
            <span class="item-span">{{orderArr.orderSn}}</span>
          </div>
          <div class="other-item">
            <b class="item-b">下单时间：</b>
            <span class="item-span">{{ item.addTime | dateformat('YYYY-MM-DD HH:mm:ss')}}</span>
          </div>
        </div>
      </div>
      <div class="order-other-msg">
        <div class="other-item">
          <span class="item-span price price-b">
            <small class="price-s">积分合计：</small>
            <em class="now">{{item.integralTotal}}</em>
          </span>
        </div>
      </div>
    </div>
  <!-- /订单详情 -->
  </div>
</template>

<script>
import Noempty from "components/Noempty/Noempty";
import { integralOrderList } from "api/pointsApi";
export default {
  data() {
    return {
      orderArr: [],
      subNumber: "", //订单编号
    };
  },
  mounted() {
    let that = this

    let subNumber = this.$route.query.subNumber
    this.getorderList();
  },
  methods: {
    //获取订单列表数据
    getorderList() {
      integralOrderList().then(res => {
          if (res.status == 1) {
              this.orderArr = res.result.resultList;
            } else {
              this.$toast(res.msg);
            }
        })
    },
    //查看订单详情
    enterOrderDetail(orderSn) {
      this.$router.push({
        path: `/orderDetail`,
        query: {
          subNumber: orderSn
        }
      });
    },
    //查看物流
    checkLogistical(orderSn) {
      this.$router.push({
        path: `/logistics`,
        query: {
          subNumber: orderSn
        }
      });
    }
  },
  components: {
    Noempty
  }
};
</script>

<style src="../../assets/css/order.css" scoped></style>